namespace RawProject
{
	class RawImage : public Glib::RefPtr<Gdk::Pixbuf>
	{
	public :
		enum WhiteBalance {WB_AUTO = 0, WB_CAMERA = 1};

		RawImage();
		~RawImage();

        void clear();
		bool LoadFromFile(Glib::ustring &, WhiteBalance wbFlag = WB_AUTO);
		void getPixelValue(int ,int , unsigned short & , unsigned short & , unsigned short & ) const;
		void applyToneMapping(int );
		void restoreImage();
	private :
        int _smallWidth;
        int _smallHeight;

        void resetBuffers();

		unsigned char * _imageBuf8;
		unsigned short * _imgCopy16;
		double * _imgLuminance;

		void saveOriginalImageBuffer();
	};
}
